package com.smedi.ismedi.constructionproject.core.port.adapter.service.impl;


import com.smedi.ismedi.constructionproject.core.application.command.MessageSendCommand;
import com.smedi.ismedi.constructionproject.core.port.adapter.restful.convert.AdapterConverter;
import com.smedi.ismedi.constructionproject.core.port.adapter.service.MessageRemoteApiService;
import com.smedi.ismedi.inmail.api.dto.request.MessagesSendRequest;
import com.smedi.ismedi.inmail.api.dto.request.QueryListTaskRecordRequest;
import com.smedi.ismedi.inmail.api.dto.request.TaskRecordRequest;
import com.smedi.ismedi.inmail.api.dto.response.TaskRecordResponse;
import com.smedi.ismedi.inmail.api.feign.RemoteMessageFeignApi;
import com.smedi.ismedi.inmail.api.feign.RemoteTaskFeignApi;
import com.smedi.ismedi.notification.api.dto.request.SendSmsRequest;
import com.smedi.ismedi.notification.api.feign.RemoteSmsNotificationFeignApi;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 发送通知实现类
 *
 * @author xienannan
 * @date 2021/08/28
 */
@Service
@AllArgsConstructor
public class MessageRemoteApiServiceImpl implements MessageRemoteApiService {

    private final RemoteSmsNotificationFeignApi remoteSmsNotificationFeignApi;
    private final AdapterConverter adapterConverter;

    @Override
    public void sendMessage(MessageSendCommand messageSendCommand) {
        SendSmsRequest sendSmsRequest = adapterConverter.sendMessageCommandToSendSmsRequest(messageSendCommand);
        remoteSmsNotificationFeignApi.postSendShortMessage(sendSmsRequest);
    }
}
